@use '@angular/material' as mat;

@mixin article-color($theme) {
  $config: mat.m2-get-color-config($theme);
  $foreground: map-get($config, foreground);
  $background: map-get($config, background);
  $primary: map-get($config, primary);
  $accent: map-get($config, accent);
  $warn: map-get($config, warn);

  $text-color: mat.m2-get-color-from-palette($foreground, text, 0.75);
  .article {
    .article-meta {
      color: $text-color;
    }
    .article-body {
      pre {
        code {
          background-color: mat.m2-get-color-from-palette($background);
        }
      }
    }
    .shadow {
      background: linear-gradient(
        0deg,
        mat.m2-get-color-from-palette($background, card),
        transparent
      );
    }
    .line {
      border: 1px dashed mat.m2-get-color-from-palette($warn);
      border-radius: 4px;
      &:hover {
        a {
          color: mat.m2-get-color-from-palette($primary);
        }
      }
    }
    .comment-list {
      background-color: mat.m2-get-color-from-palette($background, card);
      @include mat.elevation(
        3,
        mat.m2-get-color-from-palette($foreground, divider),
        0.6
      );
      .empty {
        .mat-icon {
          font-size: 60px;
          color: mat.m2-get-color-from-palette($primary, 200);
        }
      }
      .comment-box {
        .time {
          color: mat.m2-get-color-from-palette($foreground, text, 0.4);
        }
      }
    }
  }
  .menu-list {
    .list {
      .item {
        border-bottom: 1px dotted
          mat.m2-get-color-from-palette($foreground, divider);
        .num-posts {
          color: $text-color;
        }
        a {
          color: mat.m2-get-color-from-palette($foreground, text, 0.6);
          &.active {
            color: mat.m2-get-color-from-palette($primary);
          }
          &:hover {
            color: mat.m2-get-color-from-palette($primary);
          }
        }
      }
    }
    .action {
      color: mat.m2-get-color-from-palette($primary);
    }
  }
  .recent-posts {
    .list {
      .item {
        .post-img {
          &:before {
            background-color: mat.m2-get-color-from-palette($primary);
          }
          .mat-icon {
            color: mat.m2-get-color-from-palette($primary, default-contrast);
          }
        }
        .blog-title {
          a {
            color: $text-color;
            &:hover {
              color: mat.m2-get-color-from-palette($primary);
            }
          }
        }
      }
    }
  }
}
